//
//  CPJComposeTypeButton.swift
//  Sina
//
//  Created by YYY on 2017/8/24.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

import UIKit

//UIControl 内置了.touchUpInside事件
class CPJComposeTypeButton: UIControl
{
    var clsName: String?
    
    //图片
    @IBOutlet weak var btnImageView: UIImageView!
    
    //文字
    @IBOutlet weak var titleLabel: UILabel!
    
    class func composeTypeButton(imageName: String,title: String) -> CPJComposeTypeButton
    {
        let nib = UINib(nibName: "CPJComposeTypeButton", bundle: nil)
        let btn = nib.instantiate(withOwner: nil, options: nil)[0] as!CPJComposeTypeButton
        //设置图片
        btn.btnImageView.image = UIImage(named: imageName)
        //设置文字
        btn.titleLabel.text = title
        return btn
        
    }
}
